﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kocic.RepositoryManagement
{
    /// <summary>
    /// Defines methods for read operations to be used on a data object.
    /// </summary>
    /// <typeparam name="T">The type of the data object to be used in retrieve operations.</typeparam>
    public interface IRetrievable<T> : IDisposable
        where T : class
    {
        /// <summary>
        /// Defines how to return a single instance of the data object based on the specified search value.
        /// </summary>
        /// <param name="searchValue">An object used to store particular search criteria.</param>
        /// <returns>The data object that is a result of a search.</returns>
        T RetrieveSingle(Object searchValue);

        /// <summary>
        /// Defines how to retrieve multiple instances of the data object.
        /// </summary>
        /// <returns>An enumerator of a collection of type T.</returns>
        IEnumerable<T> RetrieveMultiple();

        /// <summary>
        /// Defines how to retrieve multiple instances of the data object based on the specified search value.
        /// </summary>
        /// <param name="searchValue">An object used to store particular search criteria.</param>
        /// <returns>An enumerator of a collection of type T that is the result of a search.</returns>
        IEnumerable<T> RetrieveMultiple(Object searchValue);
    }
}